package top.linruchang.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 作用：
 *
 * @author LinRuChang
 * @version 1.0
 * @date 2020/09/21
 * @since 1.8
 **/
public class RequestEnum {

    /**
     * 请求内容类型
     */
    @AllArgsConstructor
    @Getter
    public enum RequestContentTypeEnum {
        /**上传文件*/
        MULTIPART("multipart/form-data", "上传文件"),
        FORM_URLENCODED("application/x-www-form-urlencoded;charset=utf-8", "post表单默认上传内容类型"),
        JSON("application/json", "json字符串"),
        XML("text/xml", "xml字符串"),
        RAW("raw", "任意格式的字符串");

        String code;
        String description;
    }

    /**
     * 请求方式枚举
     */
    @AllArgsConstructor
    @Getter
    public enum RequestMethodEnum {

        POST("添加数据"),
        DELETE("删除数据"),
        PUT("修改数据"),
        GET("获取数据"),
        OPTION("检测服务器所支持的请求方法");
        String description;
    }

    /**
     * 响应码枚举
     */
    @AllArgsConstructor
    @Getter
    public enum ResponseCodeEnum {

        SUCCESS("200", "处理成功"),
        FAIL("500", "服务器处理请求出错"),
        UNAUTHORIZED("401", "未授权");

        /**响应码**/
        String code;
        String description;
    }

}
